package com.fq.myapplication.bean;

import com.fq.myapplication.R;

import java.util.ArrayList;
import java.util.List;

public class CommentItem {
    public CommentItem(String content, int avatar, String username, String time) {
        this.content = content;
        this.avatar = avatar;
        this.username = username;
        this.time = time;
    }

    public String content;
    public int avatar;
    public String username;
    public String time;

    // Getter methods
    public String getContent() {
        return content;
    }

    public int getAvatar() {
        return avatar;
    }

    public String getUsername() {
        return username;
    }

    public String getTime() {
        return time;
    }

    private static String[] contentArray = {"This is a good book.", "I like this book.", "The author is very talented.", "The book is very interesting.", "The book is very boring.", "The book is very long.", "The book is very short.", "The book is very expensive.", "The book is very cheap."};
    private static int[] avatars = {R.drawable.avatar};
    private static String[] usernameArray = {"John 盼年年", "Jane 你痴线呀", "Bob Johnson", "Alice 李小龙", "Tom 老板", "Mary 老板", "David 老板","goods", "likes"};
    private static String[] timeArray = {"2021-01-01 10:00:00", "2021-01-02 12:00:00", "2021-01-03 14:00:00", "2021-01-04 16:00:00", "2021-01-05 18:00:00", "2021-01-06 20:00:00", "2021-01-07 22:00:00", "2021-01-08 00:00:00", "2021-01-09 02:00:00"};

    public static List<CommentItem> getDefaultList() {
        List<CommentItem> list = new ArrayList<>();
        for (int i = 0; i < contentArray.length; i++) {
            list.add(new CommentItem(contentArray[i], avatars[i % avatars.length], usernameArray[i % usernameArray.length], timeArray[i % timeArray.length]));
        }
        return list;
    }

}
